//
// Created by Lenovo on 2020/10/24.
//
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 1e5+10;
#define ll long long
#define debug(x) cout<<#x<<": "<<x<<endl
ll oula[maxn];
ll slv(ll x)
{
    ll ans = x;
    for(int i = 2;i*i<=x;i++)
    {
        if(x%i==0)
        {
            ans = ans/i*(i-1);
            while(x%i==0) x = x/i;
        }
    }
    if(x>1) ans = ans/x*(x-1);
    return ans;
}

int main()

{
    int n;
    cin>>n;
    ll ans = 0;
    for(ll i = 1;i<n;i++) ans += slv(i);
    cout<<2*ans+1<<endl;
}

